Skip to content

stage 1 - add statistics service module#2

Merged
ivanvznkv merged 4 commits into
mainfrom
stat_svc
Mar 30, 2026
Merged

stage 1 - add statistics service module#2
ivanvznkv merged 4 commits into
mainfrom
stat_svc

Conversation

@ivanvznkv
Copy link
Copy Markdown
Owner

No description provided.

@ivanvznkv
Copy link
Copy Markdown
Owner Author

Сергей, добрый вечер!
Код по первой части дипломного проекта)

Copy link
Copy Markdown

@Ivanov-s-tmn Ivanov-s-tmn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Добавь основной сервис, пока он будет пустым, но он уже должен подниматься (pom.xml описывающий сборку основного сервиса, на данном этапе должен содержать только указание на родительский модуль и идентификатор артефакта)

private final StatsService statsService;

@PostMapping("/hit")
public ResponseEntity<Void> hit(@Valid @RequestBody EndpointHit hit) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В этой дтошке нет валидации, стоит добавить

Comment on lines +22 to +26
HitEntity entity = new HitEntity();
entity.setApp(hit.getApp());
entity.setUri(hit.getUri());
entity.setIp(hit.getIp());
entity.setTimestamp(hit.getTimestamp());
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вынеси преобразование из дто в энтити в маппер

}

public List<ViewStats> getStats(LocalDateTime start, LocalDateTime end, List<String> uris, boolean unique) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вынеси в константу

Comment thread pom.xml Outdated
Comment on lines 26 to 28
<module>statistics/dto</module>
<module>statistics/client</module>
<module>statistics/server</module>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Для сервиса статистики тут достаточно указать один модуль (основной pom.xml сервиса статистики), его подмодули уже будут описаны в помнике сервиса

@ivanvznkv ivanvznkv merged commit f462000 into main Mar 30, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants